﻿namespace ZFramework.Runtime
{
    public delegate void LoadSceneSuccessCallback(string assetName, float duration, object userData);

    public delegate void LoadSceneFailureCallback(string assetName, object userData);

    public class LoadSceneCallbacks
    {
        private readonly LoadSceneSuccessCallback _loadSceneSuccessCallback;
        private readonly LoadSceneFailureCallback _loadSceneFailureCallback;

        public LoadSceneCallbacks(LoadSceneSuccessCallback loadSceneSuccessCallback)
            : this(loadSceneSuccessCallback, null)
        {
        }

        public LoadSceneCallbacks(LoadSceneSuccessCallback loadSceneSuccessCallback,
            LoadSceneFailureCallback loadSceneFailureCallback)
        {
            _loadSceneSuccessCallback = loadSceneSuccessCallback;
            _loadSceneFailureCallback = loadSceneFailureCallback;
        }

        public LoadSceneSuccessCallback LoadSceneSuccessCallback
        {
            get { return _loadSceneSuccessCallback; }
        }

        /// <summary>
        /// 获取加载资源失败回调函数。
        /// </summary>
        public LoadSceneFailureCallback LoadSceneFailureCallback
        {
            get { return _loadSceneFailureCallback; }
        }
    }
}
